<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fhttp="http://xmlns.4suite.org/4ss/http"
  xmlns:l="http://xmlns.heustics.org/schema/i18n/0.1/"
  xmlns:o="http://xmlns.heustics.org/schema/myelin/0.1/NodeAcl#delete"
  xmlns:a="http://xmlns.heustics.org/schema/myelin/0.1/" 
  xmlns:b="http://xmlns.heustics.org/schema/myelin/0.1/NodeAcl"
  xmlns:xf="http://www.w3.org/2002/xforms"
  extension-element-prefixes="fhttp"
  exclude-result-prefixes="xsl fhttp xf l a b o"
>    
  <xsl:variable name="o:l10n" select="a:get-l10n('&a;NodeAcl#delete')"/>
  <xsl:variable name="o:titles-l10n" select="$o:l10n/l:context[@name='titles']/*"/>
  <xsl:variable name="o:params-l10n" select="$o:l10n/l:context[@name='params']/*"/>    
  <xsl:variable name="o:hints-l10n" select="$o:l10n/l:context[@name='param-hints']/*"/>
  
  <xsl:template match="a:title[@key='delete-acl-group']" mode="a:head-content">
    <xsl:call-template name="a:head-title">
      <xsl:with-param name="title" select="$o:titles-l10n[1]"/>
    </xsl:call-template>
  </xsl:template>
  
  <xsl:template match="a:title[@key='delete-acl-group']" mode="a:page-header">
    <xsl:call-template name="a:page-header-title">
      <xsl:with-param name="title" select="$o:titles-l10n[1]"/>
    </xsl:call-template>
  </xsl:template>    
  
  <xsl:template match="a:submit[@key='commit']">    
    <xsl:param name="name"/>
    <xsl:param name="l10n"/>
    <xsl:param name='key' select='@key'/>
    <div class="input submit">
      <xsl:variable name='val' select='$l10n[@key="proceed"]'/>
      <input type='hidden' name='{$key}' value='{$val}'/>
      <input type='submit' name='{$name}' value='{$val}'/>
      <div class='spacer'/>
    </div>        
  </xsl:template>   
  
  <xsl:template match="a:acls" mode="a:input-show">
    <div class="input delete-acls">
      <div class="key">
        <div>
          <xsl:call-template name="a:label-class-attr"/>
          <span>
            <xsl:value-of select="$o:params-l10n[@key='acls']"/>
          </span>
          <div class="spacer"/>
        </div>        
        <div class='hint'>
          <xsl:call-template name="a:input-hints">
            <xsl:with-param name="hint" select="$o:hints-l10n[@key='acls']"/>
          </xsl:call-template>
          <div class="spacer"/>
        </div>
        <div class="spacer"/>
      </div>  
      <div class="value">
        <div class="entry">
          <div class="options">
            <xsl:choose>
              <xsl:when test="*">
                <xsl:apply-templates mode="o:acl-group"/>
              </xsl:when>
              <xsl:otherwise>
                <span>
                  <xsl:value-of select="$b:l10n/l:gentext[@key='none-available']"/>
                </span>
              </xsl:otherwise>
            </xsl:choose>            
            <div class="spacer"/>
          </div>
          <div class="spacer"/>
        </div>        
        <div class="spacer"/>
      </div>    
      <div class="spacer"/>
    </div>
    <xsl:call-template name="o:delete-warning"/>
  </xsl:template>
  
  <xsl:template name="o:delete-warning">
    <div class="input delete-warning">
      <div class="key">
        <div>
          <span>
            <xsl:value-of select="$o:params-l10n[@key='delete-warning']"/>
          </span>
          <div class="spacer"/>
        </div>        
        <div class='hint'>
          <xsl:call-template name="a:input-hints">
            <xsl:with-param name="hint" select="$o:hints-l10n[@key='delete-warning']"/>
          </xsl:call-template>
          <div class="spacer"/>
        </div>
        <div class="spacer"/>
      </div>  
      <div class="value">
        <span>
          <xsl:value-of select="$o:l10n/*[@key='delete-warning']"/>
        </span>
        <div class="spacer"/>
      </div>    
      <div class="spacer"/>
    </div>
  </xsl:template>
  
  <xsl:template match="a:acl-group" mode="o:acl-group">    
    <div class='option acl-group'>
      <input type="checkbox" name="acl-group-tag" value="{@tag}">
        <xsl:if test="@selected">
          <xsl:attribute name="checked">checked</xsl:attribute>
        </xsl:if>
      </input>
      <span>
        <xsl:value-of select="@tag"/>
      </span>
      <div class="spacer"/>
    </div>
  </xsl:template>
  
</xsl:stylesheet>

